
//
//  MYRegisterListVC.m
//  MuYing
//
//  Created by tbb on 2019/7/19.
//  Copyright © 2019 TBB. All rights reserved.
//

#import "MYRegisterListVC.h"

@interface MYRegisterListVC ()

@end

@implementation MYRegisterListVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
}

-(void)setupView {
    [super setupView];
    
    //二者需一一对应
    self.defaultLocale = @"香港 852";
    self.mobileAreaCode = @"852";
}

#pragma mark - UITableViewDelegate, UITableViewDataSource

- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
    if (indexPath.row == 4 || indexPath.row == 3) {
        return [super tableView:tableView cellForRowAtIndexPath:indexPath];
    }else if (indexPath.row == 2) {
        return [super tableView:tableView cellForRowAtIndexPath:indexPath];
    }
    
    if (self.selectOperateType == 1) {
        if (indexPath.row == 0) {
            MYLoginBaseTextFieldPhoneCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MYLoginBaseTextFieldPhoneCell"];
            ws(self);
            [cell.leftBgView addTapAction:^(id  _Nonnull sender) {
                [weakself selectPhoneAreaCode];
            }];
            cell.placeholderStr = kYQLS(@"请输入手机号");
            return cell;
        }else{
            MYLoginBaseTextFieldCodeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MYLoginBaseTextFieldCodeCell"];
            cell.placeholderStr = kYQLS(@"请输入验证码");
            self.codeButton = cell.codeBtn;
            [cell.codeBtn addTarget:self action:@selector(sendCodeClick:) forControlEvents:UIControlEventTouchUpInside];
            self.codeTextField = cell.textField;
            return cell;
        }
    }else{
        if (indexPath.row == 0) {
            MYLoginBaseTextFieldCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MYLoginBaseTextFieldCell"];
            cell.leftIconImage = [UIImage imageNamed:@"login_em_icon"];
            cell.placeholderStr = kYQLS(@"请输入邮箱号");
            return cell;
        }else{
            MYLoginBaseTextFieldCodeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MYLoginBaseTextFieldCodeCell"];
            cell.placeholderStr = kYQLS(@"请输入验证码");
            self.codeButton = cell.codeBtn;
            [cell.codeBtn addTarget:self action:@selector(sendCodeClick:) forControlEvents:UIControlEventTouchUpInside];
            return cell;
        }
    }
    
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
}

#pragma mark - UITableViewDelegate, UITableViewDataSource end

@end
